from datetime import datetime, timedelta, date
from enum import IntEnum

print(date.today())

# 获取当前日期和时间
now = datetime.now()
print("当前日期和时间:", now.date())

# 获取前7天的日期
seven_days_ago = now - timedelta(days=7)
print("前7天的日期:", seven_days_ago.date())
# 获取今天的日期

today = datetime.now().date()

# 初始化quest_cnt_map字典
quest_cnt_map = {}

# 循环生成过去7天的数据
for i in range(7):
    # 计算过去的第i天
    date = today - timedelta(days=i)
    # 将日期格式化为字符串，并初始化每天的任务计数为0
    date_str = date.strftime("%Y-%m-%d")
    quest_cnt_map[date_str] = 0  # 或者你可以设置一个默认值，比如0

# 打印生成的字典
for date, count in quest_cnt_map.items():
    print(f"{date}: {count}")


class QuestType(IntEnum):
    NEW = 0
    FORUM = 1
    MILITARY = 2
    FK = 3
    TW = 4
    WEI_BO = 5


quest_cnt_map = {
    (today - timedelta(days=i)).strftime("%Y-%m-%d"): {type: 0 for type in QuestType}
    for i in range(7)
}
print(quest_cnt_map)
